// 培训监管
// 培训任务管理
const bscTrainingManagement = (request) => {
    return {
      // 分页
      view_bscTrainingManagement_page(query = {}) {
        return request('/application/bscTrainingManagement/page', {
          method: 'post',
          data: query
        })
      },
      // 添加
      view_bscTrainingManagement_add(query = {}) {
        return request('/application/bscTrainingManagement/add', {
          method: 'post',
          data: query
        })
      },
      // 编辑
      view_bscTrainingManagement_edit(query = {}) {
        return request('/application/bscTrainingManagement/edit', {
          method: 'post',
          data: query
        })
      },
      // 详情
      view_bscTrainingManagement_view(id) {
        return request(`/application/bscTrainingManagement/${id}`, {
            method: 'get',
          })
      },
      // 删除
      view_bscTrainingManagement_del(ids) {
        return request('/application/bscTrainingManagement/del', {
          method: 'post',
          data: {
            batchesDel:ids
          }
        })
      }, 
      // 第三方填写培训任务
      view_bscTrainingManagement_update(query){
        return request('/application/bscTrainingManagement/update', {
            method: 'post',
            data: query
          })
      }
    }
  }
  // 报名名单
  const bscTrainingSignUpRecord = (request) =>{
    return {
      //分页
      view_bscTrainingSignUpRecord_page(query){
        return request('/application/bscTrainingSignUpRecord/page', {
            method: 'post',
            data: query
          })
      },
      view_bscTrainingSignUpRecord_view(id){
        return request(`/application/bscTrainingSignUpRecord/${id}`, {
            method: 'get',
          })
      }
    }
  }
  // 签到名单
  const bscTrainingSignInRecord = (request) =>{
    return {
      //分页
      view_bscTrainingSignInRecord_page(query){
        return request('/application/bscTrainingSignInRecord/page', {
            method: 'post',
            data: query
          })
      },
      view_bscTrainingSignInRecord_view(id){
        return request(`/application/bscTrainingSignInRecord/${id}`, {
            method: 'get'
          })
      } 
    }
  }
  //内培
  const bscTrainingOrg = (request) =>{
    return {
      //分页
      view_bscTrainingOrg_page(query){
        return request('/application/bscTrainingOrg/page', {
            method: 'post',
            data: query
          })
      } ,
      //编辑
      view_bscTrainingOrg_edit(query){
        return request('/application/bscTrainingOrg/edit', {
            method: 'post',
            data: query
          })
      } ,
      // 添加
      view_bscTrainingOrg_add(query){
        return request('/application/bscTrainingOrg/add', {
            method: 'post',
            data: query
          })
      } ,
      // 删除
      view_bscTrainingOrg_del(ids){
        return request('/application/bscTrainingOrg/del', {
            method: 'post',
            data: {
              batchesDel:ids
            }
          })
      },
      // 导出
      view_ofsSubsidyApply_grant_export(data){
        return request('/application/bscTrainingOrg/export', {
          method: 'post',
          data: data
        })
      },
      // 课程详情
      view_bscTrainingOrg_view(id){
        return request(`/application/bscTrainingOrg/${id}`, {
          method: 'get',
        })
      },
    }
  }
  // 课程增删改
  const bscTrainingCourse = (request) =>{
    return {
      // 课程列表
      view_bscTrainingCourse_page(query){
        return request('/application/bscTrainingCourse/page', {
            method: 'post',
            data: query
          })
      } ,
      view_bscTrainingCourse_list(query){
        return request('/application/bscTrainingCourse/list', {
            method: 'post',
            data: query
          })
      } ,
      // 课程新增
      view_bscTrainingCourse_add(query){
        return request('/application/bscTrainingCourse/add', {
          method: 'post',
          data: query
        })
      },
      // 删除
      view_bscTrainingCourse_del(ids){
        return request('/application/bscTrainingCourse/del', {
          method: 'post',
          data: {
            batchesDel:ids
          }
        })
      },
      // 编辑
      view_bscTrainingCourse_edit(query){
        return request('/application/bscTrainingCourse/edit', {
          method: 'post',
          data: query
        })
      },
      // 下载模版
      view_bscTrainingOrg_downloadTemplate(query){
        return request('/bussiness/bscTrainingOrg/downloadTemplate', {
          method: 'post',
          responseType: 'blob',
          data: query
        })
      },
      // 导入
      view_bscTrainingOrg_import(query,onUploadProgress){
        return request('/bussiness/bscTrainingOrg/import', {
          method: 'post',
          headers: {
            'Content-Type': 'multipart/form-data; boundary=something',
          },
          onUploadProgress,
          data: query
        })
      },
    }
  }

  export default ({ request }: any) => ({
    ...bscTrainingManagement(request),
    ...bscTrainingSignUpRecord(request),
    ...bscTrainingSignInRecord(request),
    ...bscTrainingOrg(request),
    ...bscTrainingCourse(request)
  })
  